﻿
function bbauth(){
        var appid = 'myw.NBvIkY7dhz7o7ngNrTWJ3jFPQAj_86TiA5uF6v8-';
        var appdata = 'test';
        var ts = parseInt(new Date().getTime() / 1000);
        var send_userhash = '1';
        var shared_secret = 'f6f4e4a7bc94b2ccab71e980a9739fdc';
        var sig = hex_md5('/WSLogin/V1/wslogin?appid=' + appid + '&appdata=' + appdata + '&ts=' + ts + shared_secret);
        window.location.href= 'https://api.login.yahoo.com/WSLogin/V1/wslogin?appid=' + appid + '&appdata=' + appdata + '&ts=' + ts + '&sig=' + sig;
    }
function chYahoo()
{
if($("memail").value=="@yahoo.com"){
    $('mpaw').style.display="none";
    }else
    {
       $('mpaw').style.display=""; 
    }
}
function OpenF()
{
    if($("memail").value==""||$("mpaw").value=="")
    {
        return;   
    }
    showProgressBar(true);
     WebServices.My.GetLinkMan($("memail").value,"@gmail.com",$("mpaw").value,onsucc);
       
}
function onsucc(result)
{
    
    if(result[0]=="s")
    {
       RendEList(result[1],"EFend");
    }else
    { 
        alert(result[0]);
        showProgressBar(false);
    }
    

}
function CheckAllBox(box)
{
    for(var i = 0; i < _EF_TList.length; i++)
    {
        $get(_EF_TList[i]).checked = box.checked;        
    }
}
function RendEList(list,divID)
{

   var domDiv1 = $get(divID);
 
   
    if(domDiv1!=null)
    {
    if(Sys.UI.DomElement.containsCssClass(domDiv1, "DisplayNone"))
      {
           Sys.UI.DomElement.removeCssClass(domDiv1, "DisplayNone");
      }
        if($get("Emailfriend")==null) return;
        $get("Emailfriend").style.display="";
        var item= _nndd;
        var listBuilder = new Sys.StringBuilder();
        var ee='<h3>'+CT030+'</h3><div class="content628 margin20D">'+UR098+'</div><div class="signup_recommend"><strong>'+UR099.replace(/\{0\}/gi,list.length)+'</strong><table width="100%" border="0" cellpadding="5" cellspacing="1"><tr><td bgcolor="#eeeeee" width="10%"><input type="checkbox" id="Chkall" onclick="CheckAllBox(this)"checked="checked"/><label for="Chkall">'+SR009+'</label></td><td bgcolor="#eeeeee">'+CT024+'</td><td bgcolor="#eeeeee">'+C0030+'</td><td bgcolor="#eeeeee">'+C0097+'</td></tr>';
          listBuilder.append(ee);
        for (var index = 0; index < list.length; ++index) 
        {     
         var obj = list[index];
              _EF_TList[index]=obj.MemberNo;          
            var tmp = item.replace(/\$MemberNo\$/gi,obj.MemberNo);
            tmp = tmp.replace(/\$NickName\$/gi,obj.MemberNo.indexOf("@")>-1?"<span id=\"n"+obj.MemberNo+"\">"+obj.Nickname+"</span>":"<a href='/"+obj.MemberNo+".htm'><span id=\"n"+obj.MemberNo+"\">"+obj.Nickname+"</span></a>");
            tmp = tmp.replace(/\$Status\$/gi,obj.MemberNo.indexOf("@")>-1?"":"italki member");
            tmp = tmp.replace(/\$MemberCrtNo\$/gi,obj.MemberCrtNo);
            listBuilder.append(tmp);
        }
        
        var _ti='</table><p><div class="floatl"><a href="#" class="addbtn" onclick="Send()"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'+CT016+'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></a></div><div class="clear"></div></p>';
         listBuilder.append(_ti);
           domDiv1.innerHTML = listBuilder.toString();
          scroller("Emailfriend",100); 
        showProgressBar(false);
        
   }
} 
function Send()
{
var sendWname="";
var sendTname="";
   for(var i=0;i<_EF_TList.length;i++)
   {
      if($(_EF_TList[i].toString()).checked)
      {
        if(_EF_TList[i].toString().indexOf("@")>-1)
        {
            sendWname+=$("n"+_EF_TList[i].toString()).innerHTML+","+_EF_TList[i].toString()+"/";
        }
        else
        {

           sendTname+=_EF_TList[i].toString();  
        }
      }
   }
WebServices.My.SenLinkMan(sendTname,sendWname,_memberno,_rname);
top.location="/User/active_step4.htm?s=1" ;
}
